package com.minhua.jijiehao2.mainframe.common.channeldetailactivity.impl

import com.minhua.jijiehao2.base.BaseMvpPresenter
import com.minhua.jijiehao2.bean.BaseBean
import com.minhua.jijiehao2.bean.ChannelBean
import com.minhua.jijiehao2.http.CallBack
import com.minhua.jijiehao2.http.ParamsMap
import com.minhua.jijiehao2.mainframe.common.channeldetailactivity.imp.IChannelDetailPresenter
import com.minhua.jijiehao2.mainframe.common.channeldetailactivity.imp.IChannelDetailView

class ChannelDetailPresenter : BaseMvpPresenter<IChannelDetailView>(), IChannelDetailPresenter {

    private val mChannelDetailModel = ChannelDetailModel()

    override fun getLoanDetail() {
        val channelBean = v?.getChannelBean()
        val map = ParamsMap()
        map.put("id", channelBean?.id!!)
        map.put("pCode", channelBean.pcode!!)
        mChannelDetailModel.getLoanDetail(map, object : CallBack<ChannelBean>() {
            override fun onSuccess(t: BaseBean<ChannelBean>) {
                v?.onDetailSuccess(t.data!!)
            }
        })

    }

}